<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="https://unpkg.com/vue"></script>
</head>
<body>
<div id="app-1">{{fullName}}</div>
<div id="app-2">
    <input type="text" v-model="firstName">
    <input type="text" v-model="lastName">
    {{fullName1}}
</div>
<script>
    var vm=new Vue({
        data: {
            firstName: 'Foo',
            lastName: 'Bar'
        },
        computed:{
            fullName:{
                //getter
                get:function(){
                    return this.firstName+' '+this.lastName
                },
                //setter
                set:function(newName){
                    var names=newName.split(' ');
                    this.firstName=names[0];
                    this.lastName=names[names.length-1]
                }
            }
        }

    })

    var app2=new Vue({

    })
</script>
</body>
</html>